Generative Patterns
نویسندگان
چکیده
We use the concept of generative patterns to refer to patterns from which object-oriented programs can be automatically obtained. Two kinds of generative patterns are presented: propagation patterns and synchronization patterns, the former being the basis for automatic program generation, and the later being an extension for the purpose of concurrent programming. 1 What is a pattern? From the Webster dictionary, we get the following information: Word: pattern Cross references: model pattern: [...] something designed or used as a model for making things. [...] In the context of Software Engineering, we use this word to designatemodels for making objectoriented programs. These models, or patterns, exist in a programming level above object-orientation which we call adaptive programming. We call the patterns generative because they are used to generate the low level object-oriented code. Moreover, this generation follows precise rules and, therefore, can be automated by a compiler. A pattern consists of an algorithm and an applicability range. The applicability range de nes the contexts in which the generative pattern may be applied, and is determined by constraints such as paths in graphs, signature of operations and cardinality constraints. An adaptive program consists of a set of patterns with non-contradicting applicability ranges. Object-oriented programs are created from adaptive programs by a set of rules that de ne how to construct such programs from the patterns. The notation we use for our generative patterns is an extension of C++. The construction rules are given by a class dictionary (see Communications of the ACM [6]). Generative patterns are executable This research was supported in part by the National Science Foundation grant CCR-9102578 and CDA-9015692 (Research Instrumentation). Supported by the Portuguese Foundation for Research, Science and Technology (JNICT). and have a formal semantics ([5, 9]). Their main advantage to software development is the fact that they make object-oriented programs more reusable, in the sense that the algorithms have less dependencies on the speci c objects over which they operate. In addition, generative patterns are also useful as a formal language to express other kinds of patterns (namely, design patterns) de ned in the patterns community ([3, 4, 8, 2, 1]). 2 Propagation Patterns A propagation pattern de nes an operation at the adaptive programming level. The applicability range consists of a set of collaborating classes, and is speci ed by a succinct and generic subgraph specication. As an example, we present two propagation patterns in the context of Operating Systems. The rst propagation pattern returns the number of ready processes, and the second one removes the oldest ready process from the queue. We assume that the Operating System contains processes, and that these are organized in queues: OPERATION int ready_processes ( ) INIT {0;} TRAVERSE FROM OperatingSystem VIA Process TO Ready WRAPPER Ready PREFIX { return_value++; } OPERATION Process *Dispatch () TRAVERSE FROM OperatingSystem THROUGH -> *, ready_processes, * TO ReadyQueue WRAPPER ReadyQueue PREFIX { ret_value = this->get_first(); this->remove_first (); } These patterns can now be customized by speci c class dictionaries representing the Operating System structure. The following 3 class dictionaries could be used:
منابع مشابه
Educational Patterns for Generative Participants Designing for Creative Learning
In this paper, we propose a pattern language for Generative Participants. Recent education more and more requires methods to cultivate creativity in the students. A Generative Participant proposed in this paper is a teaching style aimed to cultivate creativity in its students. In a project-based environment, a Generative Participant teaches by actually participating in creative activities to st...
متن کاملGenerative Patterns of Software
The adoption of design patterns as part of software development has had a profound effect. The patterns in use, though, are essentially static in nature showing different designs that might work differently in a particular context. The originator of the notion of patterns and that of a pattern language, Christopher Alexander, has also proposed that a set of generative patterns, which influence ...
متن کاملModeling urbanization patterns with generative adversarial networks
In this study we propose a new method to simulate hyperrealistic urban patterns using Generative Adversarial Networks trained with a global urban land-use inventory. We generated a synthetic urban “universe” that qualitatively reproduces the complex spatial organization observed in global urban patterns, while being able to quantitatively recover certain key high-level urban spatial metrics.
متن کاملGenerative Models of Monolingual and Bilingual Gappy Patterns
A growing body of machine translation research aims to exploit lexical patterns (e.g., ngrams and phrase pairs) with gaps (Simard et al., 2005; Chiang, 2005; Xiong et al., 2011). Typically, these “gappy patterns” are discovered using heuristics based on word alignments or local statistics such as mutual information. In this paper, we develop generative models of monolingual and parallel text th...
متن کاملThe common patterns of nature.
We typically observe large-scale outcomes that arise from the interactions of many hidden, small-scale processes. Examples include age of disease onset, rates of amino acid substitutions and composition of ecological communities. The macroscopic patterns in each problem often vary around a characteristic shape that can be generated by neutral processes. A neutral generative model assumes that e...
متن کاملGenerative, Fully Bayesian, Gaussian, Openset Pattern Classifier
Observable patterns live in R and belong to K different classes. We are given a supervised training database, (X, L), where X represents the training patterns of all the classes and L represents their true class labels. We want to recognize the unknown classes to which new unlabelled test patterns belong. For this purpose we pretend there is a generative model, with unknown parameter Φ, that ge...
متن کامل